class AllowNullForArticleSectionId < ActiveRecord::Migration
#     Remove the not null constraint from articles.section_id,
#     in order to allow the existence of orphan articles
  def self.up
#     if undefined :default, rake migrate will complain
#     Mysql::Error: Invalid default value for 'section_id': ALTER TABLE articles CHANGE section_id section_id int(11) DEFAULT ''
    change_column :articles, :section_id, :integer, :default=>0, :null=>true
  end

  def self.down
    change_column :articles, :section_id, :integer, :null=>false
  end
end
